Skip to content

Sample code for the article on Gemini CLI vs Claude Code#751

Open
lpozo wants to merge 7 commits intomasterfrom
gemini-cli-vs-claude-code
Open

Sample code for the article on Gemini CLI vs Claude Code#751
lpozo wants to merge 7 commits intomasterfrom
gemini-cli-vs-claude-code

Conversation

@lpozo
Copy link
Copy Markdown
Contributor

@lpozo lpozo commented Apr 6, 2026

Where to put new files:

  • New files should go into a top-level subfolder, named after the article slug. For example: my-awesome-article

How to merge your changes:

  1. Make sure the CI code style tests all pass (+ run the automatic code formatter if necessary).
  2. Find an RP Team member on Slack and ask them to review & approve your PR.
  3. Once the PR has one positive ("approved") review, GitHub lets you merge the PR.
  4. 🎉

Copilot AI review requested due to automatic review settings April 6, 2026 10:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new top-level sample-code folder for the “Gemini CLI vs Claude Code” Real Python article, containing two separate CLI to-do implementations (one per tool) plus accompanying unit tests.

Changes:

  • Added gemini-cli-vs-claude-code/README.md linking the sample code to the tutorial.
  • Added a simple JSON-backed to-do CLI implementation and tests under gemini-cli/.
  • Added a more modular CLI + persistence layer implementation and tests under claude-code/.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
gemini-cli-vs-claude-code/README.md Documents the purpose of the sample-code folder and links to the article.
gemini-cli-vs-claude-code/gemini-cli/todo.py Implements a basic CLI + in-class JSON persistence for tasks.
gemini-cli-vs-claude-code/gemini-cli/test_todo.py Adds unit tests for the TodoManager implementation.
gemini-cli-vs-claude-code/claude-code/todo.py Implements a modular CLI with command handlers and formatted output.
gemini-cli-vs-claude-code/claude-code/todo_store.py Adds a dedicated JSON persistence layer with validation and helpers.
gemini-cli-vs-claude-code/claude-code/test_todo.py Adds store-level and CLI integration tests using a temporary tasks file.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


def _fmt_task(task: dict) -> str:
status = CHECK if task["completed"] else EMPTY
suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else "" # noqa
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The # noqa: E501 on this line is unnecessary because E501 is globally ignored in this repo; Ruff will report it as an unused noqa (RUF100) and fail CI. Remove the noqa (or only keep it if you enable E501 checks again).

Suggested change
suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else "" # noqa
suffix = f" (done {task['completed_at'][:10]})" if task["completed_at"] else ""

Copilot uses AI. Check for mistakes.
@@ -0,0 +1,72 @@
import json # noqa: F401
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

json is imported but never used, and the # noqa: F401 is only masking that. Removing the unused import (and the noqa) will keep the example cleaner and avoid normalizing noqa usage in sample code.

Suggested change
import json # noqa: F401

Copilot uses AI. Check for mistakes.

import json
import os
import sys # noqa: F401
Copy link

Copilot AI Apr 6, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sys is imported but not used; the # noqa: F401 is only suppressing the lint. Consider removing the unused import (and the noqa) to keep the test module clean.

Suggested change
import sys # noqa: F401

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants